package com.yyhh.helpcall.http.bean;

import com.yyhh.helpcall.utils.NetLog;
import com.yyhh.helpcall.utils.ToastUtils;

public class BaseResponse<T> {

    public int code;
    public String message;
    public long timestamp;
    public T data;

    public boolean isSuccess() {
        NetLog.d("BaseResponse " + toString());
        return code == 200;
    }

    public void showErrorMessage() {
        ToastUtils.show(message);
    }

    @Override
    public String toString() {
        return "{code=" + code + ", message=" + message + ", timestamp=" + timestamp + "}";
    }
}
